package com.zimmur.app.mocolink.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zimmur.app.mocolink.dao.AdminRoleMapper;
import com.zimmur.app.mocolink.dao.MenuMapper;
import com.zimmur.app.mocolink.domain.vo.MenuDetail;
import com.zimmur.app.mocolink.domain.vo.MenuVo;
import com.zimmur.app.mocolink.service.IMenuService;

@Service
public class MenuServiceImpl implements IMenuService {
	@Autowired
	private MenuMapper menuMapper;
	@Autowired
	private AdminRoleMapper adminRoleMapper;
	@Override
	public List<MenuVo> selectMenuWithPermission(Integer roleId) {
		return menuMapper.selectMenuWithPermission(roleId);
	}
	@Override
	public List<MenuDetail> selectByAdminId(Integer adminId) {
		
		List<Integer> roleIds=adminRoleMapper.selectByAdminId(adminId);
		List<MenuDetail>  menuList = menuMapper.selectMenuByRoleId(roleIds);
		return menuList;
	}

}
